//
//  main.m
//  size of struct
//
//  Created by apple on 15/7/31.
//  Copyright (c) 2015年 戴维营. All rights reserved.
//

#import <Foundation/Foundation.h>

//定义结构体参数和类型
struct Monkey
{
    char name[20];   //1*20 ->0~19,
    float weight;   //4 要从四到倍数开始也就是从20地址为开始，即  20~23;
    float height;       //4     24~27;
    double other;//8   32~39;
    
    //0～39，共40个字节，总的字长必须是成员中类型最长的整数倍。
};

int divide(int a,int b)
{
    assert(b);
    return a / b;
    
};
int main(int argc, const char * argv[])
{
    @autoreleasepool
    {
        struct Monkey monkey;
        
        NSLog(@"%zu",sizeof(monkey));
        NSLog(@"name = %p",monkey.name);
        NSLog(@"&weight = %p",&monkey.weight);
        NSLog(@"&height = %p",&monkey.height);
        NSLog(@"&other = %p",&monkey.other);
        
        NSLog(@"%d",divide(6,2));
    }
    return 0;
}
